﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using CottagesOfHope.Core.Concrete;
using CottagesOfHope.Core.Abstract;
using CottagesOfHope.Core.Models;

namespace CottagesOfHope.Controllers
{
    [Authorize(Roles = "Admin")]
    public class CustomerController : Controller
    {
        ////
        //// GET: /Customer/
        //private readonly ICottagesOfHopeRepository _cottagesOfHopeRepository;

        //public CustomerController(ICottagesOfHopeRepository cottagesOfHopeRepository)
        //{
        //    _cottagesOfHopeRepository = cottagesOfHopeRepository;
        //}

        //public ActionResult Index()
        //{
        //    return View(_cottagesOfHopeRepository.Customers);
        //}

        //[HttpGet]
        //public ActionResult Create()
        //{
        //    return View();
        //}

        //[HttpPost]
        //public ActionResult Create(Customer customer) 
        //{
        //    if (ModelState.IsValid)
        //    {
        //        _cottagesOfHopeRepository.SaveCustomer(customer);
        //        return RedirectToAction("Index");
        //    }

        //    return View(customer);
        //}

        //[HttpGet]
        //public ActionResult Delete(int id = 0)
        //{
        //    Customer customer = _cottagesOfHopeRepository.Customers.Single(c => c.CustomerId == id);
        //    if (customer == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(customer);
        //}
        
        //[HttpPost, ActionName("Delete")]
        //public ActionResult DeleteConfirmed(int id)
        //{
        //    Customer customer = _cottagesOfHopeRepository.Customers.Single(c => c.CustomerId == id);

        //    if (customer != null)
        //    {
        //        _cottagesOfHopeRepository.DeleteCustomer(customer);
        //        TempData["message"] = string.Format("{0} has been deleted", customer.FirstName + " " + customer.LastName);
        //    }

        //    return RedirectToAction("Index");
        //}

    }
}
